#pragma once
#include "SysConfigInterface.h"
#include "Result.h"
#include <optional>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlquery>
#include <QThread>

using namespace xiYan;

class SysConfigAccess : public SysConfigInterface
{
public:
	SysConfigAccess();
	~SysConfigAccess();

	std::optional<xiYan::Result> updateSysConfig(QString name) override;

	std::optional<xiYan::Result> openDatabase(const QString&);
	std::optional<xiYan::Result> createTable(const QString&);
private:
	QSqlDatabase m_sqliteDatabase;
	QString m_tableName;
	QThread m_thread;
};